﻿using FileTransferProtocol;
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace TestSender
{
    public class FileReader : IFileReader
    {
        private string File { get; set; }

        private Stream Stream { get; set; }

        public FileReader(string file)
        {
            File = file;
        }

        public string GetFileName()
        {
            return File;
        }

        public Stream GetFileStream()
        {
            if (Stream != null)
                return Stream;

            Stream = new FileStream(File, FileMode.Open);
            return Stream;
        }
    }
}
